// 设置
export const setLocalStorage = (name, value) =>
  localStorage.setItem(
    name,
    typeof value === 'string' ? value : JSON.stringify(value)
  )

// 获取
export const getLocalStorage = name => JSON.parse(localStorage.getItem(name))

// 删除
export const removeLocalStorage = name => localStorage.removeItem(name)

// 清空
export const clearLocalStorage = () => localStorage.clear()
